'''
Created on Jun 4, 2009

@author: mkiyer
'''

from veggie.app.application import CommandLineApplication
from veggie.app.chipseq.util import get_exper_name

class PeakFinder(CommandLineApplication):
    '''
    classdocs
    '''

    def _getExperName(self, treatment_name, control_name):
        return get_exper_name(treatment_name, control_name) + '_' + self.__class__.__name__

    def run(self, name, treatment_file, control_file=None, options=None, cwd=None):
        pass
    
    def setUp(self, treatment_name, treatments, control_name=None, controls=None, options=None, cwd=None):
        '''
        called before app execution to perform app-specific setup tasks
        
        treatment_name: sample name of treatment e.g. 'VCaP_ERG'
        control_name: sample name of control e.g. 'VCaP_PanH3'
        
        treatments/controls: list of flowcell/lane/fileformat tuples
        value: list of tuples containing three fields -- flowcell, lane, and fileformat
            flowcell   -- string e.g. '20E46AAXX'
            lanes      -- tuple e.g. (6,) or for paired-end, ('5_1', '5_2')
            fileformat -- currently accepts only 'export' 

        example:
            treatments = [('30351AAXX', ('2_1', '2_2'), 'export'),
                          ('30351AAXX', ('3_1', '3_2'), 'export')]

            controls = [('20E46AAXX', ('6',), 'export'),
                        ('20E6WAAXX', ('8',), 'export')]}
        
        options: dict of flag/value command-line options e.g. {'--verbose':None, '-min': 500}
        cwd: working directory for experiment        
        '''
        pass
    
    def tearDown(self):
        '''
        called after execution
        '''
        pass